<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Tornado Chat Demo</title>
    <link rel="stylesheet" href="{{ static_url("chat.css") }}" type="text/css">
  </head>
  <body>

    <div id="body">
<!--      <table>
	<tr>
	  <td id="users">
-->
	    <div id="users">
	      在线用户：<p/>
	      <ul id="user_list">
		{% for client in clients %}
		<li id={{client.client_id}}>{{client.username}}</li>
		{% end %}
	      </ul>
	    </div>
<!--
	  </td>
	  <td>
-->
    <div id = "right">
      <div id="inbox">
        {% for message in messages %}
          {% include "message.html" %}
        {% end %}
      </div>
      <div id="input">
        <form action="/a/message/new" method="post" id="messageform">
          <table>
            <tr>
	      <td >用户名:</td>
              <td><input name="username" id="username" style="width:100px" value="{{username}}"></td>
	    </tr>
	    <tr>
	      <td>输入消息：</td>
	      <td><input name="body" id="message" style="width:500px"></td>
	    </tr>
	    <tr>
              <td style="padding-left:5px">
                <input type="submit" value="提交">
                <input type="hidden" name="next" value="{{ request.path }}">
                {% module xsrf_form_html() %}
              </td>
            </tr>
          </table>
        </form>
      </div>
    </div>
<!--
	  </td>
	</tr>
      </table>
-->
    </div>
    <!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script> -->
    <script src="{{ static_url("jquery.min.js") }}" type="text/javascript"></script>
    <script src="{{ static_url("chat.js") }}" type="text/javascript"></script>
  </body>
</html>
